package org.noote.libs.computervision.math;

public class Vector2D  {
	public float x=0;
	public float y=0;

	public Vector2D()
	{
		this.x = 0;
		this.y = 0;
	}
	public Vector2D(float x, float y)
	{
		this.x = x;
		this.y = y;
	}
	
	public void set(float x, float y)
	{
		this.x = x;
		this.y = y;
	}

	public float getLength()
	{
		return (float)Math.sqrt(x*x + y*y);
	}
	
	public void normalize()
	{
		float l=getLength();
		x/=l;
		y/=l;
	}	
}
